<p id="notice"><%= notice %></p>

<h1 class="page-header">分类管理</h1>
<%= link_to '新增', new_admin_category_path,class: 'btn btn-primary pull-right' %>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
    <tr>
      <th>#</th>
      <th>分类名称</th>
      <th colspan="3">操作</th>
    </tr>
    </thead>
    <tbody>
    <% @categories.each do |category| %>
        <tr>
          <td><%= category.id %></td>
          <td><%=	category.name %></td>
          <td><%= link_to '查看', admin_category_path(category) %></td>
          <td><%= link_to '编辑', edit_admin_category_path(category) %></td>
          <td><%= link_to '删除', admin_category_path(category),data: { confirm: 'Are you sure?' } %></td>
        </tr>
    <% end %>
    </tbody>
  </table>
  <%= render partial: 'share/admin_pagination',locals: {pages: @categories},layout: false %>
</div>
